package io;

import java.io.FileInputStream;
import java.io.FileOutputStream;

public class CopyDemo2 {
    public static void main(String[] args) throws Exception {
        FileInputStream fis = new FileInputStream("./img_1.png");
        FileOutputStream fos = new FileOutputStream("./img_cp2.png");
        int len;
        byte[]date = new byte[1024/10];
        while ((len = fis.read(date)) != -1){
        fos.write(date,0,len);
        }
        long start = System.currentTimeMillis();
        System.out.println(start);
        long end = System.currentTimeMillis();
        System.out.println(end);
        System.out.println("复制完毕");
        System.out.println("耗时:"+(end-start)+"ms");
        fis.close();
        fos.close();
    }
}
